package metier;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;


@Entity
@Table(name = "note")
public class Note {

	@Id
	@ManyToOne(cascade = CascadeType.ALL)
    @PrimaryKeyJoinColumn(name="user", referencedColumnName="id_user")
	User user;
	
	@Id
	@ManyToOne(cascade = CascadeType.ALL)
    @PrimaryKeyJoinColumn(name="film", referencedColumnName="id_film")
	Film film;
	
	@Column (name="note")
	int note;
	
	public Note() {
		super();
		note=-1;
		// TODO Auto-generated constructor stub
	}
	
	public Note(User user, Film film, int note) {
		this.note = note;
	}
	
	
	
	public Note(int idUser, int idFilm, User user, Film film, int note) {
		super();
		this.user = user;
		this.film = film;
		this.note = note;
	}

	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public Film getFilm() {
		return film;
	}
	public void setFilm(Film film) {
		this.film = film;
	}
	public int getNote() {
		return note;
	}
	public void setNote(int note) {
		this.note = note;
	}

	
}
